<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>新增图书</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 20px;
        }

        h2 {
            color: #333;
        }

        form {
            width: 50%;
            margin-top: 20px;
        }

        label {
            display: block;
            margin-top: 10px;
        }

        input {
            width: 100%;
            padding: 8px;
            margin-top: 5px;
            box-sizing: border-box;
        }

        input[type="submit"] {
            background-color: #3498db;
            color: white;
            cursor: pointer;
        }

        a {
            color: #3498db;
            text-decoration: none;
            display: block;
            margin-top: 10px;
        }
    </style>
</head>
<body>
<h2>新增图书</h2>

<!-- 静态表单 -->
<form method="post" action="/exp6/book/add" id="bookForm">
    <label for="name">书名:</label>
    <input type="text" id="name" name="name" required>

    <label for="author">作者:</label>
    <input type="text" id="author" name="author" required>

    <label for="price">价格:</label>
    <input type="number" id="price" name="price" required>

    <label for="publisher">出版社:</label>
    <input type="text" id="publisher" name="publisher" required>

    <label for="publishDate">出版日期:</label>
    <input type="date" id="publishDate" name="publishDate" required>

    <input type="submit" value="提交">
</form>

<a href="">返回图书列表</a>

<script>
    // const form = document.getElementById('bookForm');
    // form.addEventListener('submit', ev => {
    //     ev.preventDefault();
    //     const formData = new FormData(form);
    //     formData.get("name")
    // })
</script>
</body>
</html>
